Last Updated: 2020-01-20

References: FLAC 8.1 Manual: User's Guide Problem Solving with FLAC; Command Reference; Fish in FLAC; Theory & Background

This tutorial will provide background on how to designate a number of model zones, and how to change the model geometry by changing the initial gridpoint positions.

FLAC model geometry

FLAC model geometry is designated by changing the gridpoint positions for each model zone.

Each model zone is a quadrilateral defined by 4 gridpoints, and shares its gridpoints with adjacent zones.

The figure above shows a model with 2 zones in the i-direction and 2 zones in the x-direction. If you change the position of gripoint i=2 j=2, then the geometry of all the zones will change.

What you'll learn

One of the first steps of building a model is telling FLAC how many zones the model will be in the i-direction and the j-direction. This is done with the grid command followed by two integers:

grid 10 5

The command line about would initialize a model with 10 zones in the i-direction and 5 zones in the j-direction. The default is that each zone will have a dimension of 1 x 1 with gp(1,1) at (x=0,y=0), with the units depending on what unit system you are working within FLAC. For most of the class this will be meters.

Examples of the grid command

You can try entering these into FLAC and getting the same model geometries.

Example 1: User defined function for number of zones

def $model_geometry 
   $zi = 12
   $zj = 14
end
$model_geometry

grid $zi $zj
model elastic

Example 2: Soil column model (e.g., for seismic site response)

grid 1 10

model elastic

Gridpoint coordinates are changed with the gen command (short for generate). To employ the gen command, you have to specify the four gridpoints and four gridpoint coordinates.

Example:

gen 0,0 0,0.5 1.5,0.5 1.5,0 i=1,2 j=1,2

The coordinates are listed clockwise starting with the gridpoint at the lowest i and lowest j gridpoint.

There are several options for changing gridpoint coordinates: changing gridpoint by gridpoint, or uniformly distributing zones within specified boundaries.

Example:

def $prob_defs

        $x_dimension = 8.        ;[m]
        $y_dimension = 4.        ;[m]

        $zi = 20                        ;[]
        $zj = 15                        ;[]

end
$prob_defs

grid $zi $zj
model elastic

def $build_grid

        $delta_x = $x_dimension/$zi                ;[m], zone size in x-direction
        $delta_y = $y_dimension/$zj                ;[m], zone size in y-direction
        
        $x_left = 0.        ;[m], x-coordinate left boundary of model
        loop $i (1,$zi)
                $x_right = $x_left + $delta_x        ;[m], x-coordinate of right gridpoints
                $il = $i                ;[], left gridpoints index
                $ir = $i + 1        ;[], right gridpoints index
                
                $y_bot = 0.-$y_dimension                ;[m], y-coordinate bottom of model assuming ground surface at 0m
                loop $j(1,$zj)
                        $y_top = $y_bot + $delta_y
                        $jb = $j                ;[], bottom gridpoints index
                        $jt = $j + 1        ;[], top gridpoints index
                        command
                                gen $x_left,$y_bot $x_left,$y_top $x_right,$y_top $x_right,$y_bot i=$il,$ir j=$jb,$jt
                        end_command
                        $y_bot = $y_top
                end_loop
                $x_left = $x_right
        end_loop
end
$build_grid

This example uses fish loops to assign new coordinates to each of the zones.

Since these are elements of the same size, this could more easily have been generalized with this command:

Gen 0.,-4. 0.,0. 8.,0. 8.,-4. i=1,21 j=1,16